Ext.define('truckplanner.view.mission.List' ,{
    	
	extend: 'Ext.grid.Panel',
	alias : 'widget.missionlist',
    
    title: 'Missions',
    store: 'Missions',
    width: 800,
    
    features: [Ext.create('Ext.grid.feature.Grouping',{
        groupHeaderTpl: 'Jour: {[values.name.getDate()]}-{[values.name.getMonth()+1]}-{[values.name.getFullYear()]} ({rows.length} Entrée{[values.rows.length > 1 ? "s" : ""]})'
    })],
    
    displayName : function(name) {
    	//console.log(name);
    },
    
    columns: [
            {header: 'Location',
        	columns : [{
        		header : 'De', dataIndex: 'StartLocation', flex: 0, width: 200
        	}, {
        		header : 'A', dataIndex: 'EndLocation', flex: 0, width: 200
        	}, {
        		header : 'Temps', dataIndex: 'TravelTime', flex: 0, width: 40
        	}]},
           {header: 'Travaux à réaliser',
        	columns : [{
        		header : 'Description', dataIndex: 'Work', flex: 0, width: 300
        	}, {
        		header : 'Temps', dataIndex: 'WorkTime', flex: 0, width: 40
        	}]
        },
        {header: 'X', dataIndex: 'Delete', renderer: function(value){return '<font color="#FF0000">X</font>';}, width: 18}
    ]
});
